/*
 * led.c
 *
 *  Created on: 2013-1-8
 *      Author: Al_Ways
 */
#include "led.h"
#include "stm32f10x_gpio.h"

void TurnLEDManage(bool flag)
{
	if(flag == ON)
	{
		GPIO_ResetBits(PORT_LED_MANAGE, PIN_LED_MANAGE);
	}
	else
	{
		GPIO_SetBits(PORT_LED_MANAGE, PIN_LED_MANAGE);
	}
}

void TurnLEDProgram(bool flag)
{
	if(flag == ON)
	{
		GPIO_ResetBits(PORT_LED_PROGRAM, PIN_LED_PROGRAM);
	}
	else
	{
		GPIO_SetBits(PORT_LED_PROGRAM, PIN_LED_PROGRAM);
	}
}

void TurnLEDPlay(bool flag)
{
	if(flag == ON)
	{
		GPIO_ResetBits(PORT_LED_PLAY, PIN_LED_PLAY);
	}
	else
	{
		GPIO_SetBits(PORT_LED_PLAY, PIN_LED_PLAY);
	}
}

void TurnLEDTx(bool flag)
{
	if(flag == ON)
	{
		GPIO_ResetBits(PORT_LED_TX, PIN_LED_TX);
	}
	else
	{
		GPIO_SetBits(PORT_LED_TX, PIN_LED_TX);
	}
}

void TurnLEDRx(bool flag)
{
	if(flag == ON)
	{
		GPIO_ResetBits(PORT_LED_RX, PIN_LED_RX);
	}
	else
	{
		GPIO_SetBits(PORT_LED_RX, PIN_LED_RX);
	}
}

void TurnLEDAux(bool flag)
{
	if(flag == ON)
	{
		GPIO_ResetBits(PORT_LED_AUX, PIN_LED_AUX);
	}
	else
	{
		GPIO_SetBits(PORT_LED_AUX, PIN_LED_AUX);
	}
}

void TurnLEDPower(bool flag)
{
	if(flag == ON)
	{
		GPIO_ResetBits(PORT_LED_POWER, PIN_LED_POWER);
	}
	else
	{
		GPIO_SetBits(PORT_LED_POWER, PIN_LED_POWER);
	}
}



